#ifndef RP2BONE_H
#define RP2BONE_H

#include "Rp2Node.h"
#include "Rp2Quaternion.h"

namespace Rp2
{

class Bone : public Node
{

public:
	Bone(std::string& rkName, int iID, int iParentID);
	~Bone();

	// member access
	void SetRelTranslate(Vector3f& rkT);
	void SetRelOrientation(Quaternionf& rkQ);
	const Vector3f GetRelTranslate() const;
	const Quaternionf GetRelOrientation() const;

	int GetBoneID();
	int GetParentID();

	// origin transform restore
	void SaveTransform(Vector3f& rkT, Quaternionf& rkQ);
	void RestoreTransform();

	// parent flag
	bool HasParent;

	// local transform
	Vector4f WorldTranslate;
	Matrix4f WorldOrientation;

	// translate (relative to parent)
	Vector3f RelTranslate;
	// orientation (relative to parent)
	Quaternionf RelOrientation;

private:
	int m_iBoneID;
	int m_iParentID;

	// origin transform restore
	Vector3f m_kRelTranslate_Save;
	Quaternionf m_kRelOrientation_Save;

};

#include "Rp2Bone.inl"

typedef Pointer<Bone> BonePtr;
}

#endif